package com.teradata.utils

import java.sql.{Connection, DriverManager}

class TeradataConnect {
  def db6800Connect(): Connection = {
    val conn_str = "jdbc:teradata://db6800/DBS_PORT=1025,TMODE=TERA,CHARSET=ASCII,CLIENT_CHARSET=GBK,DATABASE=dbc"
    val userName = "tetl"
    val passWord = "nmbi_tetl_lsc001"
    classOf[com.teradata.jdbc.TeraDriver]
    DriverManager.getConnection(conn_str, userName, passWord)
  }

  def portalConnect(): Connection = {
    val qd_conn_str = "jdbc:teradata://nmportal/DBS_PORT=1025,TMODE=TERA,CHARSET=ASCII,CLIENT_CHARSET=GBK,LOB_SUPPORT=off,DATABASE=dbc"
    val qd_userName = "bakarc"
    val qd_passWord = "bakarc"
    classOf[com.teradata.jdbc.TeraDriver]
    DriverManager.getConnection(qd_conn_str, qd_userName, qd_passWord)
  }

  def interface177Connect(): Connection ={
    val interface177="jdbc:teradata://10.221.158.177/DBS_PORT=8762,TMODE=TERA,CHARSET=ASCII,CLIENT_CHARSET=GBK,LOB_SUPPORT=off,DATABASE=dbc"
    val qd_userName = "bakarc"
    val qd_passWord = "bakarc"
    classOf[com.teradata.jdbc.TeraDriver]
    DriverManager.getConnection(interface177, qd_userName, qd_passWord)
  }
}
